Trouble Locking Objects within Module

Hi there,

I am a bit of a beginner with DXL but I was given some code by a colleague which supposedly locks certain objects of a module to read only based on the information provided within the DXL code. He handed me the below written code to help lock the attribute "Object Text" but when I try to run it I get the following errors:

  • In "shareable edit" mode the error reads "formal module is not open for edit".
  • In "exclusive edit" mode the error reads "The user 'therealjag' doesn't have control access" even though I do have RMCDA rights for that module.

The DXL code I used to try and lock certain objects is provided below:

Permission rcmda = delete|control
Permission r = read
Module m = current

string mName = name(m)

AttrDef ad = find(m, "Object Text") /* "Object Text" is the attribute name */

specificVal(m, ad)

err = specificVal(m,ad)

setVal (m, ad, rcmda, null)
unsetAllVal (m, ad)
setVal (m, ad, rcmda, "Object Text")
setVal (m, ad, r, null)


/* "TEST MODULE" is the name of my module */
if (mName[length(mName):] == "TEST MODULE") {
    ad = find(m, "Object Text")

 specificVal(m, ad)
 setVal (m, ad, rcmda, null)
 unsetAllVal (m, ad)
 setVal (m, ad, rcmda, "Object Text")
 setVal (m, ad, r, null)

}

if (!null err) {
errorBox (err)
halt
}

Any help would be greatly appreciated.

Thanks,

 


therealjag - Wed Jan 07 04:57:55 EST 2015

Re: Trouble Locking Objects within Module
therealjag - Thu Jan 08 06:11:42 EST 2015

Hi there,

I managed to get the code working to lock out the Object Text attribute within my specified module. However does anyone know how to narrow the code down so that it only locks out certain Object Text's instead of all the Object Texts within my module?

Below is the code which I managed to get working so far:

 

void Set_Permissions(string mod)
{
    Permission rcmda = delete|control
 Permission r = read
 Module m  = current
 /*Module m = edit(mod,false)*/

 string mName = name(m)

 AttrDef ad = find(m, "Object Text")

 unsetAllVal (m, ad)

 if (matches("Test Module", mName)) /* Module name*/
 {
  ad = find(m, "Object Text")
  specificVal(m, ad)
  setVal (m, ad, rcmda, "Object Text")
  setVal (m, ad, r, null)
 }
}

Set_Permissions("/test module area")

 

Regards,

 

Re: Trouble Locking Objects within Module
GregM_dxler - Thu Jan 08 09:09:23 EST 2015

therealjag - Thu Jan 08 06:11:42 EST 2015

Hi there,

I managed to get the code working to lock out the Object Text attribute within my specified module. However does anyone know how to narrow the code down so that it only locks out certain Object Text's instead of all the Object Texts within my module?

Below is the code which I managed to get working so far:

 

void Set_Permissions(string mod)
{
    Permission rcmda = delete|control
 Permission r = read
 Module m  = current
 /*Module m = edit(mod,false)*/

 string mName = name(m)

 AttrDef ad = find(m, "Object Text")

 unsetAllVal (m, ad)

 if (matches("Test Module", mName)) /* Module name*/
 {
  ad = find(m, "Object Text")
  specificVal(m, ad)
  setVal (m, ad, rcmda, "Object Text")
  setVal (m, ad, r, null)
 }
}

Set_Permissions("/test module area")

 

Regards,

 

Hello,

DOORS has many layers of permission.  There Is permissions for project, folder, module, object, attribute, and attribute type.  They are hierarchical, such that if you don't have permission to change a module, it won't let you change an attribute in the module, even though it says you have permission.  It's rather confusing.

You can set permissions for attributes like Object Text, but that changes the permission for the attribute in all the objects.  You can set permissions for individual objects and that will set it for all attributes in that object.  You can not set the permission for just an attribute for a single object.

Hope this helps,

Greg

Re: Trouble Locking Objects within Module
llandale - Mon Jan 12 18:41:13 EST 2015

therealjag - Thu Jan 08 06:11:42 EST 2015

Hi there,

I managed to get the code working to lock out the Object Text attribute within my specified module. However does anyone know how to narrow the code down so that it only locks out certain Object Text's instead of all the Object Texts within my module?

Below is the code which I managed to get working so far:

 

void Set_Permissions(string mod)
{
    Permission rcmda = delete|control
 Permission r = read
 Module m  = current
 /*Module m = edit(mod,false)*/

 string mName = name(m)

 AttrDef ad = find(m, "Object Text")

 unsetAllVal (m, ad)

 if (matches("Test Module", mName)) /* Module name*/
 {
  ad = find(m, "Object Text")
  specificVal(m, ad)
  setVal (m, ad, rcmda, "Object Text")
  setVal (m, ad, r, null)
 }
}

Set_Permissions("/test module area")

 

Regards,

 

This other group I worked with found a way to split up a logical module into 3 parrellel sibling modules.  Main attributes (Text, IsReq etc) in the 1st; 2ndary Verification attributes in the 2nd, and other attributes in the 3rd.  Some milestone locks down the "requirements" and nobody but certain admins can edit m1.  Once Verification is defined m2 is locked down.  Yet we can still edit the residual attributes in m3.  The Key to this Schema is a maintence script that made sure the trios of modules were always in sync.

I have never managed access to a module adequately; vis-a-vis locking down certain attributes.  I hear tell some other folks have done it reasonably successfully.   Too many attributes with specific permission spread out over too many modules.

If you are comfortable with DXL, It is a lot easier to write ..err.. I mean manage a pre-attribute-save trigger.  Someone may TRY to edit Object Text for this module, but fails AFTER they try and BEFORE the change occurrs.  You can in-place edit but not save when you click some other object.  You could have data-driven code, read which objects are "finished" and which attributes are "locked".  The trigger would fire; if the triggered objects is "Finsihed" and the attributing being modified is "locked" then disallow the save; otherwise allow it.  You could have some module-level attribute(s) that contain this information; and is changable only by module admins.  There needs to be a mechanism for "admins" to make changes.  Lets not talk about that outloud here.

I would do this:  Have an on-demand script that allows the user to define locked-out attributes and sections for modules.  Project admins can run this and its stored in a Config file.  Deploy the pre-attribute-save trigger in the Project and not in each module; it reads the config file for orders.  Success with this scheme would be the ability of the on-demand script to present existing rights and duplicate rights for many modules.  I would get grandiose and allow the definitions of a lock-down "Template" (which sections/attributes), and then assign associate modules with lock-down templates.

-Louie

Mmmm, the script should allow edits for folks in certain groups.  "CPS" folks can edit Object Text in "Phase 3" modules, but not in "Phase 4".